package com.mathmodeling.repository;

import com.mathmodeling.entity.Team;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface TeamRepository extends JpaRepository<Team, String> {
    
    /**
     * 根据队长ID查找团队
     */
    Optional<Team> findByCaptainId(String captainId);
    
    /**
     * 根据团队名称查找团队
     */
    Optional<Team> findByName(String name);
    
    /**
     * 检查团队名称是否存在
     */
    boolean existsByName(String name);
} 